package dataStructure;

import java.util.ArrayList;

public class DataObject {

	 
	private ArrayList <DataObject> children;
	private String tagName;
	private DataObject parentObject;
	private ObjectType type;
	private String value;
	
	
	//CONSTRUCTOR
	public DataObject(String tagName, DataObject parent)
	{	
		this.children = new ArrayList <DataObject>();
		this.tagName = tagName;
		this.parentObject = parent;
		this.value = "";
	}
	
	
	
	//GETTERS	
	public ArrayList<DataObject> getChildren()
	{
		return this.children;
	}
	
	public String getTagName()
	{
		return this.tagName;
	}
	
	public DataObject getParentObject()
	{
		return this.parentObject;	
	}	
	
	public ObjectType getType()
	{
		return this.type;
	}
	
	public String getValue()
	{
		return this.value;
	}
	//END GETTERS
	
	
	//SETTERS
	
	public void setChildren(ArrayList<DataObject> children)
	{
		this.children = children;
	}
	
	public void setTagName(String tagName)
	{
		this.tagName = tagName;
	}
	
	public void setParentObject(DataObject parent)
	{
		this.parentObject = parent;	
	}
	
	public void setType(ObjectType type)
	{
		this.type = type;
	}
	
	public void setValue(String value)
	{
		this.value = value;
	}
	//END SETTERS
	
	
	//HELPER CLASSES
	
	//add a child to the arrayList
	public void addChild(DataObject newChild)
	{
		this.children.add(newChild);		
	}	
	

	//END HELPER CLASSES
	
	
}
